An area called a stack is set on a memory in order to execute a program by an information processing apparatus such as a computer. A storage area of the stack is allocated for each procedure, for example, when a program procedure (e.g., function) is called. A partial storage area of the stack allocated to one procedure may be called a stack frame. For example, arguments and local variables used for execution of procedures are stored in the stack frame.
Data stored in a stack may be destroyed by other programs, memory faults, or the like. Destruction of data stored in the stack may be the cause of malfunction of a program or an information processing apparatus that executes the program. Therefore, it is considered to detect abnormality of data stored in the stack area.
For example, there is a proposal for a computer which stores a hash value of data to be stored in a stack area in the stack area at the same time and uses the hash value to detect a data abnormality. In this proposal, when executing a program, a hash value recalculated from the data in the stack area is compared with the stored hash value and the data abnormality in the stack area is notified to the user when the two hash values are different from each other.
There is also a proposal to suppress a stack smashing attack caused by a buffer overflow on a stack by checking the validity of a guard variable stored between a preview frame pointer and an array of the stack in a return process of a function.
Related techniques are disclosed in, for example, Japanese Laid-Open Patent Publication Nos. 2010-198147 and 2001-216161.